On the Subject of Ribbit Programming
Is this frogramming?
This module has a D-Pad (consisting of four directional arrows and a middle button), a small input display, a start and reset button, and a large game of “Frogger”.
From bottom to top, you are shown:
- A thin patch of grass (the starting point) with a frog. You will be controlling this frog.
- A street with multiple cars. (Initially frozen in place.)
- A second thin patch of grass (the middle point).
- A river with logs and turtles. (Initially frozen in place.)
- A final thin patch of grass with gaps (the goal points).
The goal is to pre-program the movements of the frog such that it moves from the bottom patch of grass to one of the top goal points, whilst weaving through the traffic in the streets and jumping on the logs and turtles in the river.
The frog can be programmed to either move up, right, down, left, (with the directional buttons on the D-Pad) or wait (with the central button on the D-Pad). Moving the frog in any direction causes it to jump one unit in the given direction.
The length of one unit is illustrated along the top and right of the module via short lines. The patches of grass are each one unit wide, the street and river are each four units wide, and the goal points are one unit wide.
The cars, turtles, and frog are one unit long and one unit wide. The logs and groups of turtles are one unit wide and can be several units long. One of the street lanes has a lorry instead of a car, which is two units long.
If the frog jumps onto a log or turtle, the frog will move at the same rate as the log or turtle it is standing on.
While the program executes, the moving items (car, lorry, log or turtle) move sideways at constant rates (wrapping across the edges of the game), while the frog’s own movements occur instantaneously at every integer time step. The first command occurs at time 1.